<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateCommunitiesTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('communities', function (Blueprint $table) {
            $table->increments('id');
            $table->integer('province')->unsigned()->nullable()->comment('省id');
            $table->string('provincename')->nullable()->comment('省');
            $table->integer('region')->unsigned()->nullable()->comment('所属区域id');
            $table->string('regionname')->nullable()->comment('楼盘所属区域名称');
            $table->integer('area')->unsigned()->nullable()->comment('区id');
            $table->string('areaname')->nullable()->comment('区/县');
            $table->integer('town_id')->unsigned()->nullable()->comment('镇id');
            $table->string('town')->nullable()->comment('镇');
            $table->integer('metro_id')->unsigned()->nullable()->comment('地铁线id');
            $table->integer('metro_station_id')->unsigned()->nullable()->comment('地铁站id');
            $table->string('title')->comment('小区名称');
            $table->string('address')->comment('小区地址');
            $table->integer('year')->nullable()->unsigned()->comment('建筑年代');
            $table->string('map')->nullable()->comment('地图坐标');
            $table->integer('dealnum')->nullable()->default(0)->comment('最近成交');
            $table->string('feature')->nullable()->comment('小区特色');
            $table->string('thumb')->nullable()->comment('缩略图');
            $table->text('images')->nullable()->comment('大图');
            $table->text('content')->nullable()->comment('小区介绍');
            $table->string('build_type')->nullable()->comment('建筑类型');
            $table->string('age_limit')->nullable()->comment('产权年限');
            $table->string('cover_area')->nullable()->comment('占地面积');
            $table->string('build_area')->nullable()->comment('建筑面积');
            $table->string('volume_rate')->nullable()->comment('容积率');
            $table->string('green_rate')->nullable()->comment('绿化率');
            $table->string('plan_num')->nullable()->comment('规划户数');
            $table->string('park_place')->nullable()->comment('车位情况');
            $table->string('pm_type')->nullable()->comment('物业类型:Z 住宅 X 写字楼 B 别墅 S 商铺');
            $table->string('pmc')->nullable()->comment('物业公司');
            $table->string('pm_fee')->nullable()->comment('物业费');
            $table->string('developer')->nullable()->comment('开发商');
            $table->string('seo_title')->nullable()->comment('SEO标题');
            $table->string('seo_keywords')->nullable()->comment('SEO关键词');
            $table->string('seo_description')->nullable()->comment('SEO描述');
            $table->string('status')->default('T')->comment('状态 T 启用 F 禁用');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('communities');
    }
}
